package com.mzy.datepackage.M2022.Jun.tw;

import com.mzy.datepackage.M2022.Jun.TenThree.object;

import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/6/20 10:20
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        V2ConfigParams v2ConfigParams = new V2ConfigParams();
        ArrayList<Ip> objects = new ArrayList<>();
        Ip ip = new Ip("aa","ss");
        Ip ip2 = new Ip("aa","ss");
        objects.add(ip);
        objects.add(ip2);
        v2ConfigParams.setIp(objects);
        Class<?> clazz = v2ConfigParams.getClass();
        Field declaredField = clazz.getDeclaredField("ip");
        declaredField.setAccessible(true);
        System.out.println(declaredField);
        Object o = declaredField.get(v2ConfigParams);
        System.out.println(o);

        //
        Type genericType = declaredField.getGenericType();
        System.out.println(genericType);
        System.out.println(declaredField.getType());

    }
}
